<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // Set 数据结构
    const s = new Set()
    s.add(1).add(2).add(3).add(4).add(2)
    console.log(s)

    // s.forEach(i => console.log(i))

    // for (let i of s) {
    //   console.log(i)
    // }

    // console.log(s.size)

    // console.log(s.has(4))

    // console.log(s.delete(100))
    // console.log(s)

    // s.clear()
    // console.log(s)

    // 数组去重
    const arr = [1.3,4,6,2,4,7,5,8]
    // const b = Array.from(new Set(arr))
    const b = [...new Set(arr)]
    console.log(b)
  </script>
</body>
</html>